// 封装工程路径
const fs = require("fs");
const path = require("path");

// process.cwd(): 获取到当前文件所在目录的绝对路径
const appDirectory = fs.realpathSync(process.cwd());
// 根据相对路径获取绝对路径
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);

module.exports = {
    resolveApp,
    appPublic: resolveApp('public'),
    appHtml: resolveApp('public/index.html'),
    appSrc: resolveApp('src'),
    appDist: resolveApp('dist'),
    appTsConfig: resolveApp('tsconfig.json')
}